import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { UserOutlined } from '@vicons/antd'; //引入图标
import { renderIcon } from '@/utils/index'; //工具函数，用于渲染图标

const routeName = 'employee';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/employee',
    name: routeName,
    redirect: '/employee/info',
    component: Layout,
    meta: {
      title: '员工档案',
      icon: renderIcon(UserOutlined),
      //permissions: ['dashboard_console', 'dashboard_console', 'dashboard_workplace'],
      sort: 1,
    },
    children: [
      {
        path: 'info',
        name: `${routeName}_info`,
        meta: {
          title: '员工列表',
          permissions: ['dashboard_console'],
        },
        component: () => import('@/views/employee/index.vue'),
      },
      // {
      //   path: 'monitor',
      //   name: `${ routeName }_monitor`,
      //   meta: {
      //     title: '监控页',
      //     permissions: ['dashboard_monitor']
      //   },
      //   component: () => import('@/views/dashboard/monitor/monitor.vue')
      // },
    ],
  },
];

export default routes;
